<template>
  <div class="record_box">
    <div class="common_problem">
      <span>通过记录可查看返利进度;其他问题请点击</span>
      <div class="btn" @click="problemClick">常见问题</div>
    </div>
    <ul v-if="list !== null">
      <li v-for="(item, index) in list" :key="index" @click="itemClick(item.apply_id)">
        <div class="gameicon">
          <img :src="item.gameicon" alt="">
        </div>
        <div class="center-content">
          <div class="center-info">
            <div class="gamename">{{item.gamename}}</div>
            <div class="gamedate">充值时间：{{item.day_time}}</div>
            <div class="gamemoney">申请金额：{{item.usable_total}}元({{item.xh_showname}})</div>
          </div>
          <div style="font-size: .346667rem;">
            <div v-if="item.status === -2" style="color: #EC2424">申请失败</div>
            <div v-else-if="item.status === -1" style="color: #808080">已撤回</div>
            <div v-else-if="item.status === 1" style="color: #288dff">等待受理</div>
            <div v-else-if="item.status === 2" style="color: #41AC14">受理中</div>
            <div v-else-if="item.status === 10" style="color: #FF951C">已发放</div>
          </div>
        </div>
        <div class="table-list-icon"></div>
      </li>
    </ul>
    <rebate-empty v-else/>
  </div>
</template>

<script>
import RebateEmpty from './RebateEmpty.vue'
  export default {
  components: { RebateEmpty },
    props: {
      list: {
        type: Array,
        default: null, 
      },
    },
    methods: {
      itemClick(id) {
        this.$router.push('/rebate_apply_info/apply_id/' + id)
      },
      problemClick() {
        this.$router.push({
          path:'/rebate/help',
          query: {
            index: 1
          }
        })
      }
    },
  }
</script>

<style lang="less" scoped>
.common_problem {
  padding: .333333rem 0;
  font-size: .293333rem;
  font-weight: 500;
  color: #666;
  display: flex;
  align-items: center;
  .btn {
    width: 1.813333rem;
    height: .773333rem;
    line-height: .773333rem;
    font-size: .32rem;
    border: .013333rem solid #FFAA00;
    border-radius: .386667rem;
    text-align: center;
    color: #FFAA00;
    margin-left: .266667rem;
  }
}

.record_box {
  box-sizing: border-box;
  width: 10rem;
  padding: 0 .426667rem;
  ul {
    width: 9.146667rem;
    font-size: .32rem;
    li {
      box-sizing: border-box;
      width: 9.146667rem;
      height: 2.506667rem;
      padding: .4rem .266667rem;
      border-radius: .266667rem;
      background: #fff;
      margin-bottom: .266667rem;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
  }
}

.table-list-icon {
  width: .373333rem;
  height: .373333rem;
  background: url('../../../assets/img/rebate/ic_right.png') no-repeat;
  background-size: 100%;
}

.gameicon {
  width: 1.706667rem;
  height: 1.706667rem;
  /* background: olive; */
  margin-right: .293333rem;
  img {
    display: inline-block;
    width: 1.706667rem;
    height: 1.706667rem;
  }
}

.center-content {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.center-info {
  height: 1.706667rem;
  width: 4.8rem;
  display: flex;
  flex-direction: column;
  font-size: .32rem;
  color: #999999;
}

.gamename {
  font-size: .373333rem;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  color: #222222;
  font-weight: bold;
}

.gamedate {
  margin-top: .373333rem;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.gamemoney {
  margin-top: .133333rem;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}


</style>